import React,{Component} from 'react';

// 每个路由跳转，都会进入该函数一次。。。
export default function Skeleton (){

    var location = window.location;
    let pathname = location.pathname;
    console.log(location.href)
    console.log(location.pathname)
    let pathType = ""
    if(pathname.match("^\/$")){
      console.log("index")
      pathType="index"
    }else if(pathname.match("^\/counter")){
      pathType = "counter"
    }
    switch(pathType){
      case "index":
        return(
          <div>loading index</div>
        )
      case "counter" :
      return(
        <div>loading counter</div>
      )
      default: 
      return(
        <div>loading</div>
      )
    }

}